package cn.yhp.gateway.session;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**数据处理器基类
 * @author yhp
 * @description
 * @date 2024/5/6
 */
public abstract class BaseHandler<T> extends SimpleChannelInboundHandler<T> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, T msg) throws Exception {
        session(ctx,ctx.channel(),msg);
    }

    protected abstract void session(ChannelHandlerContext ctx, Channel channel,T msg);
}
